import 'package:flutter/material.dart';

// 点击后调用 onTap 回调函数
class TapWrapper extends StatelessWidget {
  final Widget? child;
  final VoidCallback? onTap;

  const TapWrapper({
    Key? key,
    this.child,
    this.onTap,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      child: child,
    );
  }
}